package com.chzu.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chzu.mapper.ActivityInfoMapper;
import com.chzu.pojo.ActivityInfo;
import com.chzu.pojo.vo.ElementSelectVo;
import com.chzu.service.ActivityInfoService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author lz
 * @Version 1.0
 * @Company 滁州大健康与养老产业研究院
 * @ClassName ActivityInfoServiceImpl
 * @Description TODO
 * @Date 2022/02/13 18:04
 */
@Service
public class ActivityInfoServiceImpl extends ServiceImpl<ActivityInfoMapper, ActivityInfo> implements ActivityInfoService {

    @Resource
    private ActivityInfoMapper activityInfoMapper;

    /**
     * 逻辑删除活动信息
     * @param id 主键id
     * @return
     */
    @Override
    public boolean deleteActivity(Long id) {
        return activityInfoMapper.deleteActivity(id);
    }

    /**
     *  根据活动的开始时间获取最新一条数据展示
     * @return
     */
    @Override
    public ActivityInfo getNewOneInfoByStartTime() {
        return activityInfoMapper.getNewOneInfoByStartTime();
    }

    /**
     * 获取所有活动的主题
     * @return
     */
    @Override
    public List<ElementSelectVo> getAllTheme() {
        return activityInfoMapper.getAllTheme();
    }

    /**
     * 按照主题名称查寻活动信息
     * @param theme 活动的主题
     * @return
     */
    @Override
    public ActivityInfo getAllActivityByTheme(String theme) {
        return activityInfoMapper.getAllActivityByTheme(theme);
    }
}
